home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS Toolkit
/
BBS Toolkit.iso
/
pc_board
/
pbank21b.zip
/
AWARD.PPS
< prev
next >
Wrap
Text File
|
1993-06-16
|
4KB
|
84 lines
;*****************************************************************************
;* *
;* AWARD BANK V1.0 *
;* *
;* using PCBoard Programming Language [PPL] *
;* to work with PPL Time Bank *
;* *
;* Written by: Peter Veeck *
;* *
;* posted on Saltair: 06-15-93 *
;* *
;* *
;* Modification History: See History.doc file *
;* *
;*****************************************************************************
;
; Cmd line: award nnn [nn]
;
:DEFINE_VARIABLES
INTEGER chgtime,found,opts,note_line
STRING disp_file,count,junk,disp_award
STRING usertoken(10)
:SET_PARAMETERS
note_line = 4 ; Line to use for storage in NOTES PSA
; will be overridden if environment variable
:START ; PBANK is set.
GETTOKEN chgtime
disp_award = "award" + gettoken()
IF (GETENV("PBANK")) DO ; Check for environment variable
TOKENIZE GETENV("PBANK") ;
GETTOKEN junk
GETTOKEN junk
GETTOKEN junk
GETTOKEN junk
GETTOKEN note_line ;
ENDIF ; of the variables listed here.
IF (!(PSA(6))) DO ;
LOG "You must have the NOTES PSA installed for Awards.",0
goto EXIT
ENDIF
GETUSER
IF ((U_NOTES(note_line)) = ("")) DO
opts = 0
GOTO NEWBANK
ELSE
found = 0
TOKENIZE U_NOTES(note_line) ; Split up NOTES line
opts = TOKCOUNT()
IF (opts > 10) DO ; too many tokens for array?
LOG "Too many tokens on NOTES line to use Award",0
GOTO EXIT
ENDIF
FOR count = 1 TO opts ; Get bank info from notes line
GETTOKEN usertoken(count) ;
if (usertoken(count) == "BANK") found = count
ENDFOR
if (found > 0) goto POST
ENDIF
:NEWBANK
IF (opts > 7) DO ; too many tokens for array?
LOG "Too many tokens on NOTES line for Award.",0
GOTO EXIT
ENDIF
IF (!(INSTR(U_NOTES(note_line)," "))) DO ; room to store bank?
LOG "Not enough room on NOTES line to set up new bank.",0
GOTO EXIT
ENDIF
found = opts + 1
opts = opts + 3
usertoken(found) = "BANK"
usertoken(found+1) = "TIME"
usertoken(found+2) = 0
:POST
usertoken(found+2) = usertoken(found+2) + chgtime
U_NOTES(note_line) = usertoken(1) ; Put U_NOTES back
FOR count = 2 TO (opts) ; together
U_NOTES(note_line) = U_NOTES(note_line)+" "+usertoken(count) ;
ENDFOR
PUTUSER ; update bank
LOG "Awarded: "+ STRING(chgtime) +"min. Total Bank time: "+STRING(usertoken(found+2))+" min.",0
IF (EXIST(PPEPATH() + disp_award)) DISPFILE PPEPATH() + disp_award,LANG+GRAPH
:EXIT
END